function plot_nyquist_filter(t,n,h1,h2,M)
subplot(2,1,1)
stem(n,h1(n));
hold on;
scatter(n(1:M:end), h1(n(1:M:end)),100,'k','filled');

plot(t,h1(t),'b:');
hold off;
legend('h[n]','h[Mn]','Underying Analog Sinc','location','northwest');
xlabel('n')
title(num2str(M)+"-Nyquist Filter Example (sinc)");
ylim([-0.5,1.1]);

subplot(2,1,2)
stem(n,h2(n));
hold on;
scatter(n(1:M:end), h2(n(1:M:end)),100,'k','filled');
plot(t,h2(t),'b:');
hold off;
legend('h[n]','h[Mn]','Underying Analog Triangle','location','northwest');
xlabel('n')
title(num2str(M)+"-Nyquist Filter Example (Triangle) ");
ylim([-0.5,1.1]);
